package ckw.database.resultPattern;

import java.util.Comparator;

public class VotingSubcardOptionResultPattern implements Comparator<VotingSubcardOptionResultPattern> {
	private String name;
	private String subcardName;
	private int votes;
	private Long id;
	
	public VotingSubcardOptionResultPattern() {
		super();
	}
	
	public VotingSubcardOptionResultPattern(String name) {
		super();
		this.name = name;
	}
	
	public VotingSubcardOptionResultPattern(String name, String subcardName,
			int votes, Long id) {
		super();
		this.name = name;
		this.subcardName = subcardName;
		this.votes = votes;
		this.id = id;
	}
	
	@Override
	public int compare(VotingSubcardOptionResultPattern o1,
			VotingSubcardOptionResultPattern o2) {
		if (o1.getVotes() < o2.getVotes())
			return 1;
		else if(o1.getVotes() > o2.getVotes())
			return -1;
		else
			return 0;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSubcardName() {
		return subcardName;
	}

	public void setSubcardName(String subcardName) {
		this.subcardName = subcardName;
	}

	public int getVotes() {
		return votes;
	}

	public void setVotes(int votes) {
		this.votes = votes;
	}

	public Long getId() {
		return id;
	}

	protected void setId(Long id) {
		this.id = id;
	}	
}
